<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /*
        1.var 是函数级别作用域
        2.let关键字：
              1：let是块级别作用域

        */

        /*    if(true){
                let i=10;
                console.log(i);
               }   */

        {
            let itbaizhan = 10;
            var sxt = 1;
        }



        for (let i = 0; i < 10; i++) {
            console.log(i);
        }


       /* var a = [];
        for (var i = 0; i < 10; i++) {
            a[i] = function () {
                console.log(i);
            };
        }


        a[6](); // 10  */



       /* var b = [];
        for (let i = 0; i <= 10; i++) {
            b[i] = function () {
                console.log(i);
            };
        }
        b[6](); //6  */



        let j=10;
        console.log(j);






    </script>
</body>

</html>